home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / ImageMaster_d3.adf / piarc.lzh.parta / imfc24r.rexx < prev    next >
OS/2 REXX Batch file  |  1993-03-23  |  4KB  |  147 lines

  1. /*
  2.  * imfc24r.rexx
  3.  *
  4.  *  Written by: Barry Chalmers and Ben Williams
  5.  * Last Update: April 20th, 1992
  6.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  7.  * ---------------------------------------------------------------------------
  8.  *    Revision: 1.02 - see ReadMe file for details on changes to this level
  9.  *              1.03 - passed in parameters for selective redraw
  10.  *                     and two monitor operation
  11.  */
  12. call pragma('stack',20000);
  13.  
  14. /*
  15.  * Default display modes   - These are used when this is called with
  16.  *                           selective redraw parameters
  17.  */
  18.  def_overscan = 0;  /* 0 = non-overscan,  1 = overscan                     */
  19.  def_fcres    = 3;  /* 0 = 384x482, 1 = 512x482, 2 = 768x482, 3 = 1024x482 */
  20.  def_twomonitor = 1; /* 0 = one screen, 1 = using a second screen          */
  21.  
  22. parse arg jackin dx1 dy1 dx2 dy2
  23.  
  24. if jackin = 'finish' then do
  25.   exit 0;
  26.   end;
  27.  
  28. /*
  29.  * open rexxsupport.library -- needed for some functions
  30.  */
  31. if ~show('L',"rexxsupport.library") then do
  32.   if addlib('rexxsupport.library',0,-30,0) then do
  33.       /* everything's ok */
  34.     end;
  35.   else do
  36.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  37.     say 'Cannot operate script without this library - sorry!';
  38.     exit 10;
  39.     end;
  40.   end;
  41.  
  42. /*
  43.  * This will automatically direct the script to the proper
  44.  * software, if it is running.
  45.  */
  46. prtnme = 'IP_Port'; /* assume Image Professional */
  47. if show('P','IP_Port') = 0 then do
  48.   if show('P','IM_Port') = 0 then do
  49.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  50.     say "This script requires IP, IM or IM F/c to run!";
  51.     exit(20);
  52.     end;
  53.   else do
  54.     prtnme = 'IM_Port'; /* That's the thing about assumptions... */
  55.     end;                 /* We make em, user's break em.          */
  56.   end;
  57.  
  58.   /*
  59.    * This code attempts to read a file called "picmdpath" from REXX:
  60.    * If it can't find it, the script will assume that the commands
  61.    * associated with this PI Module are in "c:". If the file exists,
  62.    * the script will look in the path that is specified in the file.
  63.    * If you create this file, you MUST put a complete, correct path
  64.    * in it; if the commands are in a sub-directory, you have to put
  65.    * the trailing slash on the path (like, device:dir/).
  66.    * 
  67.    */
  68.   cmdpath = 'c:';
  69.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  70.     do
  71.       cmdpath = readln(fhandle);
  72.       call close(fhandle);  /* close the file    */
  73.     end
  74.  
  75. address(prtnme);
  76.  
  77. if jackin > 0 then do
  78.   overscan     = def_overscan;
  79.   fcres        = def_fcres;
  80.   twomonitor   = def_twomonitor;
  81. end;
  82. else do
  83.   options results;
  84.   'askyn "Overlay Mode","Using a Second Monitor"';
  85.   twomonitor = result;
  86.   options;
  87.   
  88.   options results;
  89.   'askyn "Display Non- Overscan","Display Overscan"';
  90.   overscan = result;
  91.   options;
  92.   
  93.   options results;
  94.   'gadgets "Lo-Res","384x482","Med-Res","512x482","Med-Res","768x482","Hi-Res","1024x482"';
  95.   fcres = result;
  96.   options;
  97.   if fcres = 0 then do
  98.     address;
  99.     exit 0;
  100.     end
  101.   fcres = fcres - 1;
  102.   
  103.   'wbtofront';
  104.   
  105.   options results;
  106.   'jackin';
  107.   jackin = result;
  108.   options;
  109. end;
  110.  
  111. /* Although XSTART and YSTART are optional                          */
  112. /* (IMFC24 centers them when defaulting), you will probably want    */
  113. /* to set XSTART at least, for your Amiga and preferences.          */
  114. /* A good guess for YSTART is 40.                                   */
  115.  
  116. if fcres = 0 then do
  117.   xstart = 40;
  118.   ystart = 40;
  119.   end
  120. if fcres = 1 then do
  121.   xstart = 56;
  122.   ystart = 40;
  123.   end
  124. if fcres = 2 then do
  125.   xstart = 78;
  126.   ystart = 40;
  127.   end
  128. if fcres = 3 then do
  129.   xstart = 104;
  130.   ystart = 40;
  131.   end
  132.  
  133. /* USAGE for the IMFC24 program is                             */
  134. /*      IMFC24 <jackin> [fcres] [overscan] [xstart] [ystart] [twomonitor] [dx1] [dy1] [dx2] [dy2] */
  135. /* Default is                                                  */
  136. /*      IMFC24    -        0        0      (center) (center)   */  
  137.  
  138. address command cmdpath||'imfc24 '||jackin||' '||fcres||' '||overscan||' '||xstart||' '||ystart||' '||twomonitor||' '||dx1||' '||dy1||' '||dx2||' '||dy2;
  139. address(prtnme);
  140.  
  141. 'tofront';
  142. 'FCREDRAW';
  143. 'finish';
  144. address;
  145.  
  146. exit 0;
  147.